package C;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class C64 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        System.out.println(getResult(input));
    }

    public static int getResult(String input) {
        Map<Character,Integer> map = new HashMap<>();
        input.chars().forEach(c->map.put((char)c,map.getOrDefault((char)c,0)+1));
        int up = fact(input.length());
        int low = 0;
        low = map.entrySet().stream()
                .filter(entry->entry.getValue()>1)
                .mapToInt(entry->fact(entry.getValue()))
                .sum();
        return up/low;
    }

    public static int fact(int num) {
        int sum = 1;
        for (int i=1;i<=num;i++) {
            sum*=i;
        }
        return sum;
    }
}
